package ex_from_web;

import java.util.HashSet;
import java.util.Set;

/**
 * Sum of set elements
 */
public class Hashbrown_1 {

	public static void main(String[] args) {
		// populate set
		Set<Integer> elements = new HashSet<Integer>();
		elements.add(10);
		elements.add(20);
		elements.add(30);
		// calculate sum
		int sum = 0;
		for (int i : elements)
			sum += i;
		System.out.println("Sum: " + sum);
	}

}
